﻿using System;
using System.Reflection;

namespace Phoenix.Xna.Framework.Serialization.Markup.Properties
{
    /// <summary>
    /// Defines the intermediary markup property object definition.
    /// </summary>
    internal interface IMarkupProperty : IMarkupElement
    {
        /// <summary>
        /// Gets or sets the name of the property.
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// Gets or sets the System.Type of the defined object.
        /// </summary>
        Type ObjectType { get; set; }

        /// <summary>
        /// Gets a value indicating this property is not default, and should be serialized.
        /// </summary>
        bool ShouldPersist { get; }

        /// <summary>
        /// Extract the markup information from the PropertyInfo for this property.
        /// </summary>
        /// <param name="property">The PropertyInfo for this property.</param>
        /// <param name="value">The value of the property.</param>
        void ExtractMarkup(PropertyInfo property, object value);

        /// <summary>
        /// Sets the value of MarkupProperty to the instance's property value.
        /// </summary>
        /// <param name="instance">The instance to set the property on.</param>
        void SetValue(object instance);
    }
}
